package cn.accjiyun.gomoku.model;

import cn.accjiyun.gomoku.view.BoardLayoutController;

/**
 * Created by jiyun on 2016/10/6.
 */
public class EngineLevel {

    public final static int FOOL = 1;

    public final static int EASY = 2;

    public final static int NORMAL = 3;

    public final static int DIFFICULT = 4;

    public final static int CUSTOM = 0;

    public static int saveDepth;
    public static int saveWidth;

    public final static void setLevel(int level) {
        switch (level) {
            case FOOL :
                BoardLayoutController.setMaxDepth(2);
                BoardLayoutController.setMaxWidth(8);
                break;
            case EASY :
                BoardLayoutController.setMaxDepth(4);
                BoardLayoutController.setMaxWidth(16);
                break;
            case NORMAL :
                BoardLayoutController.setMaxDepth(6);
                BoardLayoutController.setMaxWidth(18);
                break;
            case DIFFICULT :
                BoardLayoutController.setMaxDepth(8);
                BoardLayoutController.setMaxWidth(20);
                break;
            default:
                break;
        }
    }

    public final static void setLevel(int level, int depth, int width) {
        if (level == CUSTOM) {
            saveDepth = depth;
            saveWidth = width;
            BoardLayoutController.setMaxDepth(depth);
            BoardLayoutController.setMaxWidth(width);
        }
    }
}
